#ifndef CHESS_MOVE_HISTORY_H
#define CHESS_MOVE_HISTORY_H

#include "Move.h"
#include <vector>
#include <stdio.h>
class Board;

/**
 * This MoveHistory class simply holds all the moves previously made
 */
class MoveHistory {
   public: //methods

      //! Constructor
      MoveHistory(std::string filename = "") {
	if (filename == "")
	   Initialize();
	else
	   LoadHistory(filename);
      }

      //! Saves the history to the provided ostream
      //! @param os the ostream to be written to
      //! @returns the ostream
      std::ostream & SaveHistory(std::ostream & os);

      void AddMove(Move m);

      //! Undo the last Move in the list
      Move UndoMove();

   private:
      //! Loads the previously stored History from the file
      void LoadHistory(std::string filename);
      //! Initializes an empty MoveHistory
      void Initialize();
      //! The list of previously made moves
      std::vector<Move> moveList;
};

#endif
